<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Index
 *
 * @author ananda
 */
class Action_Main_Index extends Action
{
    public function main()
    {
        global $app;
        $controller = $app->createController('Relation');
        $action = $app->createAction($controller, 'Index', array());

        Com::dump($action->ping(), 'Ping');

        Com::dump($action->getListToUser(11), 'getListToUser (11 empty)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (11 empty)');
        Com::dump($action->getListToUser(11), 'getListToUser (22 empty)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (22 empty)');
        Com::dump($action->getListToUser(11), 'getListToUser (33 empty)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (33 empty)');

        Com::dump($action->appendUser(11, 22), 'appendToUser (11 To 22)');
        Com::dump($action->appendUser(33, 11), 'appendToUser (33 To 11)');
        Com::dump($action->getListToUser(11), 'getListToUser (1)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (1)');
        Com::dump($action->cancelUser(11, 22), 'cancelToUser (11 To 22)');
        Com::dump($action->cancelUser(33, 11), 'cancelFromUser (11 From 33)');

        Com::dump($action->getListToUser(11), 'getListToUser (11 2)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (11 2)');
        Com::dump($action->getListToUser(11), 'getListToUser (22 2)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (22 2)');
        Com::dump($action->getListToUser(11), 'getListToUser (33 2)');
        Com::dump($action->getListFromUser(11), 'getListFromUser (33 2)');
    }

    public function sample()
    {
        echo '<hr />';
        // 读取配置演示
        Com::dump(Com::glob()->conf['com.dsn.mysql01']);

        // 翻译词条演示
        Com::dump(Com::glob()->t['common.title']);
    }
}
